<template>
    <model title="News">
        <table id="table" class="table table-hover news-table" data-pagination="true" data-search="true"
               data-page-list="[10]" data-page-size="10">
        </table>
    </model>
</template>

<script>
    export default {
        name: "news",
        mounted() {
            axios.post("/PTSG/news/getAllNews").then(res => {

                $("#table").bootstrapTable({
                    data: res.data,
                    showHeader: false,
                    columns: [
                        {
                            field: "news",
                            formatter: function (value, row, index) {
                                return "<a href='/news/newsDetailPage?id=" + row.id + "'><i class='fa fa-play'></i> " + row.news + "</a>";
                            }
                        }, {
                            field: "date"
                        }
                    ]
                })

            })


        }
    }
</script>

<style lang="scss">

    .news-table {
        width: 95%;
        margin-bottom: 10px !important;
        margin: 0 auto;
        border: 0 solid transparent !important;

        tbody {
            tr {
                border-bottom: 1px dashed #ddd !important;

                    td {
                        margin-left: 2em;
                        font-size: 16px;
                        vertical-align:bottom !important;
                        height: 50px;
                        border: 0 solid transparent !important;
                    }

            }
        }
    }

</style>